﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QThread>
#include <QDebug>
#include <QString>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    QThread workerThread;
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    QString res;

signals:
    //发送信号触发线程
    void operate(const QString &);

public slots:
    //处理线程执行的结果
    void handleResults(const QString &result)
    {
        qDebug() << "receive the resultReady signal--";
        qDebug() << " mainwindow.h  current thread ID:" << QThread::currentThreadId() << '\n';
        res=result;
        qDebug() << res;
    }
private slots:
    void on_pushButton_clicked();
};

#endif // MAINWINDOW_H
